package main.java.thread;

public class CurrentThreadDemo {
    public static void main(String[] args) {
        //Boo boo = new Boo();
        Thread main = Thread.currentThread();
        System.out.println("主线程名称：" + main);
        doSome();

        Thread t1 = new Thread(){
            public void run(){
                Thread current = Thread.currentThread();
                System.out.println("子线程名称：" + current);
                doSome();
            }
        };
        t1.start();
    }
    public static void doSome() {
        synchronized (Boo.class) {
            Thread t = Thread.currentThread();
            System.out.println("子线程名称：" + t);
        }
    }
}